With the increasing availability of match film (streams/YouTube/Vimeo/etc.) as well as the growing use of the Advantage system, I often need to quickly and easily download match film from a variety of different sources. The method outlined here involves downloading and installing a few very small programs, but it doesn’t require you to watch anything, operates in the background, and downloads rather quickly. Installation is different on Windows and macOS; both are outlined below. Here’s what I did:

Download and Installation of Programs

Download/Clip Video

Download and Installation of Programs

Using Windows

Download youtube-dl

This is a program that uses command-line inputs and can download almost any type of stream I’ve come across, including YouTube, Vimeo, Facebook Live, and UStream (what Infinity Park often uses to broadcast matches).

Go to the youtube-dl download page and follow instructions to download the Windows version (“Windows.exe”).

youtube-dl download website

Download FFmpeg

This is a program that uses command-line inputs to edit, convert, and do a whole bunch of other things to audio and video files. While youtube-dl will do the downloading, FFmpeg will do the trimming of longer videos.

Go to the FFmpeg download page and download the correct version for your operating system. Don’t click the big green “Download” button–you probably want the Windows installer instead.

FFmpeg download website

You can click this “Download” button!

FFmpeg Windows download

Go into a folder (I chose C:/Program Files since that’s where my applications live), and create a new folder called “ffmpeg”.

Unzip the FFmpeg files and copy everything in the unzipped folder here.

Move youtube-dl.exe to …/ffmpeg/bin

Find where youtube-dl.exe was downloaded and move this file into the “bin” folder under the “ffmpeg” folder you just made.

Add .../ffmpeg/bin to your PATH

This is the tricky part; again, I only know how to make this work on Windows. Other operating systems might not even have to do this part.

  1. Hit the Windows key and type “variables”.

Search to change environmental variables

  1. Select “Environmental Variables” in the bottom right of the window that pops up.

Change environmental variables

  1. Under “User variables for…”, click “New”.

New PATH

  1. Variable Name = PATH

New PATH

  1. Browse for where you moved all of the FFmpeg files.

  1. Hit “OK”

Check installation using Command Prompt

Hit the Windows key and type “cmd” to open the Command Prompt. Type “ffmpeg” and hit enter. If a bunch of information pops up, it’s installed properly. Type “youtube-dl” and hit enter. If it tells you that you need to provide a URL, it’s installed properly.

Using macOS

Install Homebrew

Homebrew is a package manager for macOS. Installing it makes everything else pretty straightforward. To install it, open Terminal by pressing Command+Space, typing “terminal”, and pressing enter. Paste the following into the Terminal prompt and press enter:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

If it asks for your password, enter the password to your computer’s user profile and hit enter. You won’t see the characters as you enter them.

Install youtube-dl

In the Terminal, paste the following:

brew install youtube-dl

Check that installation was successful by typing youtube-dl and pressing enter. If your error looks like the following, you’re good to go:

Install FFmpeg

In the terminal, paste the following:

brew install ffmpeg

Check that installation was successful by typing ffmpeg and pressing enter. If your error looks like the following, you’re good to go:

Downloading Video

Simple download

Want to download a complete video? That’s super easy now that everything is installed.

Open the Command Prompt/Terminal. Type the following, replacing the URL below with that of your video.

youtube-dl http://www.youtube.com/yourvideo

Done!

This method also works with videos on Facebook, Vimeo, ESPN, NBCSports… the list goes on.

Password protection

Some videos, especially those that teams post on Vimeo, are password protected. To get at the video, use the argument --video-password after the call to youtube-dl.

youtube-dl https://vimeo.com/188625468 --video-password “Purple Strength”

Playlists and combining videos

Sometimes, teams will post match film to YouTube in a series of videos, especially when they pause recording at stoppages. youtube-dl will download all of the videos at once by plugging in the playlist URL.

youtube-dl https://www.youtube.com/playlist?list=teamplaylist1234

Unfortunately, these will wind up being completely separate videos. We’ll use ffmpeg to combine all of these into one.

Save a .txt file containing the location of each file you’d like to combine in the order you’d like them combined. Make sure each line starts with the word “file”. It should look something like this:

file "desktop/myvideo1.mp4"
file "desktop/myvideo2.mp4"
file "desktop/myvideo2.mp4"

Once this is done, open the Command Prompt (Windows key + “cmd”) or Terminal (Cmd+Space + “terminal”). Type the following, replacing the inputs with that of the text file and what you want to call the resulting video.

ffmpeg -f -safe 0 -i "TEXT FILE" -codec copy "FILE NAME"
  • “TEXT FILE” is the location on your computer of the file we made above. Something like “C:/users/mike/desktop/input.txt”
  • “FILE NAME” is what you want to name the file. It should end in “.mp4” or some other video format.

Clipped download

Only want part of a multi-hour stream? Figure out where your match starts and ends (hours, minutes, and seconds into the stream).

Bring up the Command Prompt (hit the Windows key and type “cmd”, or CMD+Space+“terminal” in macOS). Type the following:

ffmpeg -ss STARTTIME -i "STREAM URL"" -to ENDTIME -c copy -copyts "FILE NAME"
  • “STARTTIME” is the beginning timestamp of your match. HH:MM:SS.S
  • “STREAM URL” is the URL of the stream. If the download doesn’t work the first time around, try it again, but with this in quotes.
  • “ENDTIME” is the end timestamp of your match. HH:MM:SS.S
  • “FILENAME” is what you want to name the file. It should end in “.mp4” or some other video format.

So, to download a 1 minute section of one of my matches this summer:

ffmpeg -ss 02:06:55.0 -i http://main.soundque.com:1935/vod/USAR08082015f2.mp4/chunklist_w149588290.m3u8 -to 02:07:55.0 -c copy -copyts ob_army_platesemi.mp4

Alternatively, you can list the length of time you’d like to download by dropping -copyts and using -t instead of -to.

ffmpeg -ss 02:06:55.0 -i http://main.soundque.com:1935/vod/USAR08082015f2.mp4/chunklist_w149588290.m3u8 -t 00:01:00.0 -c copy ob_army_platesemi.mp4

Note: this only works if you use the direct file URL. You can get this by typing the following and pasting one of the output URLs into the code above:

youtube-dl -g https://www.youtube.com/thevideoURL

The more difficult streams

Just to warn you: some streams may take a bit of extra digging, but it’s fast and easy once you know what to look for. Make sure FFmpeg is installed and working before proceeding.

  1. Go to the webpage of the video you’d like to download. Right click and select “Inspect” (here I’m using Chrome).

  1. A window will open with the HTML code that makes up the website. Look around for a tab named “Network”. Click it, then type “.m3u8” in the box on the top left that says “filter”. Refresh the webpage. Some lines will start streaming by–copy the link address of one of the lines.

An M3U8 file is what most video players use to load streams, which is why this works. Basically, it points the program to the media file on the website’s servers, which you download directly.

  1. Open the command prompt and type the following, replacing “YOUR ADDRESS” with the URL you just copied. If there are spaces in the URL, this must be in quotes to work.
youtube-dl "YOUR ADDRESS"

Downloading FloRugby’s “Shorts Challenge” would look like this:

youtube-dl https://player.ooyala.com/hls/player/all/JhdGZnZzE64_-Mntz-AQIDiATi3mrRPL/media/4000.m3u8

You can combine this with the clipping code above if you only want a section. Place the -ss section before the URL and the -t after.

ffmpeg -ss 00:58 -i "https://player.ooyala.com/hls/player/all/JhdGZnZzE64_-Mntz-AQIDiATi3mrRPL/media/4000.m3u8" -t 00:05 -c copy shorts_clipped.mp4

Down the rabbit hole

Sometimes things don’t work as nicely as I hope they would. I’ll keep this section updated with some other tricks.

ESPN+

DRM makes everything tough. Now that Iona and Harvard broadcast their matches through ESPN+, others will probably follow suit. Or, maybe you just want to grab a clip from one of the professional matches for which ESPN has the rights. We’ll need to jump through some hoops to download the ESPN+ content regardless.

  1. Log into ESPN+ and find the video you’d like to download.

  2. In Chrome, right click and select Inspect, then Network as outlined above.

  3. Refresh the page.

  4. Filter for “entitlements”; under “Request Headers” one link will have dss-session-token: followed by a lot of characters. Copy and paste these somewhere.

  5. Filter for “m3u8”, copy the link to the m3u8 of choice.

  6. Run the following, inserting the copied key and m3u8 url:

youtube-dl --add-header "Authorization:**pasteDSSTOKENhere**" "**m3u8URLhere**"

THE END

PS: There are a bunch of other things you can do with both youtube-dl and FFmpeg. For more documentation/help, visit their websites:

youtube-dl

FFmpeg